<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/8
 * Time: 10:01
 */

namespace app\admin\controller\mall;


use app\common\controller\AdminController;
use think\app;
use think\facade\View;

class GoodsCate extends AdminController
{
    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->model = app('app\common\model\common\Categories');
        $this->order = 'sort asc';
    }
    public function otherData(){

        $data = $this->model->field('id,name,parent_id')->with(['childs'=>function($query){
            $query->where(['type'=>3]);
        }
        ])->where(['parent_id'=>0,'type'=>3])->order('sort asc')->select();

        View::assign('otherData',$data);
    }

    public function get_where(){
        $arr['type'] = 3;
        return $arr;
    }

}